<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="true" label-width="88px">
      <el-form-item label="渠道订单号" >
        <el-input
          v-model="queryParams.tradeno2"
          placeholder="请输入渠道订单号"
          clearable
          size="small"
          style="width: 240px"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="queryOrderByNo">搜索</el-button>
      </el-form-item>

    </el-form>

    <div>查询到结果后将下面内容复制到网店管家进行售后登记</div>
    <hr>
    <div  v-html="rep">

    </div>
  </div>
</template>

<script>
  import { queryOrder } from "@/api/admin/afterSale";

  export default {
    data() {
      return {

        "rep":"",
        queryParams: {
          tradeno2:""
        }
      }
    },
    methods: {
      queryOrderByNo() {
        queryOrder(this.queryParams).then(response => {

            if(response.data){
              //let str = JSON.stringify(response.data);
              //alert(str);

              let showText = "渠道: " + response.data.channel + "<br />";
              showText = showText + "下单时间: " + response.data.times + "<br />";
              showText = showText + "客户: " + response.data.customer + "<br />";
              showText = showText + "电话: " + response.data.phone + "<br />";
              showText = showText + "地址: " + response.data.adr + "<br />";
              showText = showText + "商品: " + response.data.detailinfo + "<br />";
              showText = showText + "物流单号: " + response.data.logisticno + "<br />";
              showText = showText + "客诉: " + response.data.ks + "<br />";


              this.rep = showText;



            }else{
              alert("订单号错误,无法查到该订单");
            }

          }
        );
      }
    }
  };
</script>
